<?php

/**
 * LayoutBehavior class
 *
 * @author Julot <andy.julot@gmail.com>
 * @since Monday, January 30, 2012. 09:21 AM
 */
class LayoutBehavior extends CBehavior {

	public function getMenu() {
		static $menu;

		if (!isset($menu)) {
			$user = Yii::app()->user;
			$menu = array(
				array(
					'label'=>'Home',
					'url'=>array('/site/index')
				),
				array(
					'label'=>'Jadwal',
					'url'=>array(
						'/site/page',
						'view'=>'schedule'
					)
				),
				array(
					'label'=>'Kesaksian',
					'url'=>array('/testimony')
				),
				array(
					'label'=>'Outlet',
					'url'=>array(
						'/site/page',
						'view'=>'outlet'
					)
				),
//			array(
//				'label'=>'Contact',
//				'url'=>array('/site/contact')
//			),
				array('label'=>'Login',
					'url'=>array('/site/login'),
					'visible'=>$user->isGuest),
				array(
					'label'=>'Logout (' . $user->name . ')',
					'url'=>array('/site/logout'),
					'visible'=>!$user->isGuest
				),
			);
		}

		return $menu;
	}

}
